home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / Updates / HD-Installer / -WHDLoad- / WHDLoad_dev / Src / sources / blitfix_imm_58a6.s < prev    next >
Text File  |  1999-11-08  |  1KB  |  60 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    blitfix_imm_58a6.s
  3. ;  :Contents.    routine to fix program that does not correctly wait for
  4. ;        blitter finish
  5. ;        the instruction which writes the "bltsize" register will be
  6. ;        patched with a routine which will wait for blitter finish
  7. ;        after writing "bltsize"
  8. ;  :Version.    $Id: blitfix_imm_58a6.s 1.1 1998/06/14 20:54:50 jah Exp $
  9. ;  :History.    30.08.97 extracted from Turrican slave
  10. ;  :Requires.    -
  11. ;  :Copyright.    Public Domain
  12. ;  :Language.    68000 Assembler
  13. ;  :Translator.    Barfly V1.131
  14. ;  :To Do.
  15. ;---------------------------------------------------------------------------*
  16. ;
  17. ; this will patch the following instruction:
  18. ;        move.w    #XXXX,($58,a6)
  19. ;
  20. ; IN:    A0 = APTR start of memory to patch
  21. ;    A1 = APTR end of memory to patch
  22. ;    A2 = APTR space for patch routine MUST be < $8000 !!!
  23. ; OUT:    D0-D1/A0-A1 destroyed
  24.  
  25. _blitfix_imm_58a6
  26.         move.l    a2,-(a7)
  27.     IFD PATCHCOUNT
  28.         clr.w    (6,a2)
  29.     ENDC
  30.  
  31. .loop        cmp.w    #$3d7c,(a0)+        ;move.w #xxxx,($xxxx,a6)
  32.         bne    .next
  33.         cmp.w    #$0058,(2,a0)
  34.         bne    .next
  35.         move.w    (a0),(2,a0)        ;save blitsize
  36.         subq.w    #2,a0
  37.         move.w    #$4eb8,(a0)+        ;JSR $xxxx.w
  38.         move.w    a2,(a0)+
  39.     IFD PATCHCOUNT
  40.         addq.w    #1,(6,a2)
  41.     ENDC
  42. .next        cmp.l    a0,a1
  43.         bhs    .loop
  44.  
  45.         move.w    #$4ef9,(a2)+        ;JMP $xxxxxxxx.l
  46.         lea    .movewait,a0
  47.         move.l    a0,(a2)+
  48.         
  49.         move.l    (a7)+,a2
  50.         rts
  51.  
  52. .movewait    move.l    a0,-(a7)
  53.         move.l    (4,a7),a0
  54.         move.w    (a0)+,($58,a6)
  55.         move.l    a0,(4,a7)
  56.         move.l    (a7)+,a0
  57.         BLITWAIT a6
  58.         rts
  59.  
  60.